home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / amac41.zip / RING12.QM < prev    next >
Text File  |  1991-08-26  |  47KB  |  966 lines

  1. *                               RING12.QM, v 1.2a
  2. *             Macros To Select and Load Files In QEdit Ring
  3. *                        Written by Tom Hogshead
  4. *                                8/24/91
  5. *
  6. *                     Macros To Be Run While Editing Only
  7. *        ============================================================
  8. *  @(f2) Save List of Files In Ring, Restore With @f1 and/or RING.BAT     |new
  9. *       (Does *NOT* Emulate PC Magazine's FILECTRL.COM after Loading)
  10. *
  11. *  @(2)  Select and Load Files From a PickList of All Files In Ring,      |chg
  12. *        File Edit Statuses Are Unchanged
  13. *       (Does *NOT* Emulate PC Magazine's FILECTRL.COM after Loading)
  14. *               (Written by Tom Hogshead and John Goodman)
  15. *
  16. *  @(3)² Select and Load Files From a PickList of All Files In Ring       |chg
  17. *
  18. *  @(4)² Select and Load Files From a DOS "DIR" Picklist, User Inputs
  19. *        File Pattern To Make PickList
  20. *
  21. *  @(5)² Select and Load Files From a PickList Made Using Directory
  22. *        Extended, DX.EXE, User Selects Desired File Extension and
  23. *        Sort Options From a Pre-Made File "FILE.SRT" To Make PickList
  24. *  @(6)² Select and Load Files From a PickList Made Using Directory
  25. *        Extended, DX.EXE, User Inputs File Pattern and Sorting Options
  26. *        To Make PickList
  27. *
  28. *  @(8)² Load While Editing All Files In Pre-Made List of Files,
  29. *        Modification of @1
  30. *
  31. *  @(9)² Begin or Continue Emulation of PC Magazine's FILECTRL.COM
  32. *        After Macros @1 to @7 Have Been Stopped
  33. *
  34. *
  35. *  Key    Subfile          Macros To Be Run From Command Line Only
  36. * ====== =========  =====================================================
  37. *  @(f1) {e:\up\ring@f1}
  38. *        Load Previously Saved List of Files Made With @f2                |new
  39. *       (Does *NOT* Emulate PC Magazine's FILECTRL.COM After Loading)
  40. *
  41. *  @(7)² {e:\up\ring@7}                                                   |1.2a
  42. *        Load At Command Line All Files From a Pre-Made List of Files,
  43. *        Modification of @1
  44. *
  45. *  @(0)² {e:\up\ring@0}
  46. *        Load At Command Line First File In a Pre-Made List of Files,
  47. *        Faster Version of @1, Does Not Enter All Files In Ring
  48. *
  49. *  @(1)  {e:\up\ring@1}
  50. *        Load At Command Line All Files From a Pre-Made List of Files,
  51. *       (Does *NOT* Emulate PC Magazine's FILECTRL.COM After Loading)
  52. *       (Written by Kyle Watkins of SemWare)
  53. *
  54. *                              Other Macros
  55. *                             ==============
  56. *  @(F6) Makes Sorted DIR List of File Names in Conventional "8.3" Format
  57. *             NO SPACES, with Date and Time, like this:
  58. *             FILE25.QM       64795   6-23-91   4:12a
  59. *
  60. *  @(r)  Reset to DefaultWordSet After Macros Complete
  61. *  @(h)  Jump From Index Line To Locate Macro or Item In Document Below
  62. *
  63. *    Misc
  64. *   ======
  65. *   (Description)
  66. *   (Macros)
  67. *   (Autoexecute) Start up Macros
  68. *   (Syntax) to autoexecute macros
  69. *   (Locate) macros and items in file from Index, how to
  70. *   (FILECTRL).COM from PC Magazine
  71. *   (Directory) Extended DX.EXE
  72. *   (AMACxx).ZIP
  73. *   (Uploaded) sources for AMACxx
  74. *   (NEWKEY) macro to close windows and set "DefaultWordSet"
  75. *   (RING_TST.QM) tests for optimum ring loop technique
  76. *   (Problems) or suggestions?
  77. *   (Version) History
  78. *
  79. *   ---------
  80. *   ( )² Macro keys with superscript² denotes emulation of FILECTRL.COM
  81. *
  82. *-- eoi
  83.  
  84.  
  85. *  (Description):
  86. *  ---------------
  87.  
  88. *   QEdit macros in RING12.QM emulate PC Magazine's FILECTRL.COM enabling
  89. *   the user to know  what files are in the  ring and in what order,  and
  90. *   give the capability to load a file in the ring  *without*  having  to
  91. *   nextfile through the  ring.  Files may be loaded from a list of files
  92. *   at the  command line or  from a PickList  of files in  the ring while
  93. *   editing.  Directory Extended DX.EXE is required for some macros.
  94.  
  95. *   Comparisons are  made in (RING_TST.QM) of  speed, versatility and the
  96. *   limitations of  different macro techniques to  loop through all files
  97. *   loaded in the ring, perform any  desired function on each file in the
  98. *   ring, and end in the file we started in.
  99.  
  100. *  (Autoexecute) Start up Macros:
  101. *   -----------------------------
  102.  
  103. *   Macros @f1, @1, @0 and @7 must be the  first  macros in  the  file to
  104. *   autoexecute at  start up.  The user must make  a list of  files to be
  105. *   loaded, one file per line, to use these four macros:
  106.  
  107. *       file1.ext
  108. *       file2.ext
  109. *       etc.
  110.  
  111. *   I find it convenient to name each file list with the extension ".ql".
  112.  
  113. *  (Syntax) to autoexecute:
  114. *  ------------------------
  115.  
  116. *               Q.EXE  [  file_list ]  /E[ macfile.mac ]  /L[ macfile.mac ]
  117.  
  118. *   For example, if my  file list is FILELIST.QL  and  I have macro @0 as
  119. *   the first macro in a file whose macfile is named ring@0.mac, to begin
  120. *   editing the first file in  FILELIST.QL, after executing the following
  121. *   command,  press <enter>,  or cursor down to  another file in the list
  122. *   and press <enter>:
  123.  
  124. *               q  filelist.ql  /Ering@0.mac  /LRING12.mac                  |
  125.  
  126. *   Pressing <enter> repeatedly, cycles between the file list for another
  127. *   file to select and a full window with the selected file.
  128.  
  129. *   For this file with @0 as the first macro:
  130.  
  131. *               q  ring.ql   /ERING12.mac   /LRING12.mac                    |
  132. *               <enter>
  133. *               <enter> at pause to load RING12.qm
  134.  
  135. *   The file list "ring.ql" is:
  136.  
  137. *                 RING12.qm                                                 |
  138. *                 ring.inf                                                  |
  139. *                 ring_tst.qm                                               |
  140. *                 pick2.bat                                                 |
  141. *                 ring.lst                                                  |
  142. *                 ring.ql                                                   |
  143.                                                                             |
  144.  
  145. *   Pressing escape three time stops cycling.  Cycling can be started again
  146. *   at any time using macro @9.
  147.  
  148. *   Alternatively, the following may be used:                               |
  149.  
  150. *               q  [ file_list ]   /Ering@0.mac   /LRING12.mac              |
  151. *               q  [ file_list ]   /Ering@1.mac   /LRING12.mac              |
  152. *               q  [ file_list ]   /Ering@7.mac   /LRING12.mac              |
  153.  
  154. *  (Directory) Extended DX.EXE:
  155. *   ----------------------------
  156.  
  157. *   Directory Extended is the most powerful and versatile file management
  158. *   program I am aware of.  DX.EXE file list function is used  in some of   |
  159. *   these macros to make a file list of files of a specified file pattern
  160. *   sorted by name, date, or extension.  It is available in AMAC-PRG.ZIP,
  161. *   or on BBS's as DX260 or the earlier version DX210.
  162.  
  163. *  (FILECTRL).COM
  164. *   --------------
  165.  
  166. *   I was impressed by the functionality of PC Magazine's FILECTRL.COM in
  167. *   the  July 1991 issue, v10n13.   It overcomes  one  of the significant
  168. *   deficiencies of *all* file and directory programs I am aware of, what
  169. *   I  call "blind"  lists. The  text file  contents of  the file  can be
  170. *   determined with each cursor down/up  without having to press <enter>.
  171. *   These macros were written to  "partially" emulate this function. It's
  172. *   probably easier for  you to see  how each macro  works rather than me
  173. *   try to describe more  than I have. I have  tried to include enough to
  174. *   get  you started.  Any  questions or  problems,  please let  me know.
  175.  
  176. *  (AMACxx).ZIP:
  177. *   -------------
  178.  
  179. *   AMACxx.ZIP is a collection of QEdit  macros I have put together. Many
  180. *   I   have   written,  and  John   Goodman  has  recently contributed
  181. *   extensively to this  effort.  As of this  writing, the latest version
  182. *   is AMACxx.ZIP is v38 with  new macros and subsequent changes in
  183. *   AMAC-K.ZIP. Program files used with these macros are in AMAC-PRG.ZIP.
  184. *   AMACxx.ZIP is (uploaded) to CompuServe IBMAPP Lib  0  (Lib 1  after 30
  185. *   days in Lib 0), Exec-PC (414-789-4210),  and SemWare (404-641-8968).
  186. *   All are PC Pursuitable except CompuServe.
  187.  
  188. *  (Problems) or suggestions?
  189. *   --------------------------
  190.  
  191. *   Any problems  or suggestion,  I would  like to  hear from  you. I can
  192. *   be reached daily on either  SemWare,  Exec-PC  or  NewWare.   I check
  193. *   CompuServe only once a month. I  will also try to include your useful
  194. *   macros in AMAC  if you send them to me.  Hope you  find some of these
  195. *   macros useful.  I have enjoyed writing them.  Thanks.
  196.  
  197. *   Tom Hogshead
  198.  
  199. *  (Macros):
  200. *  =========
  201.  
  202. * 
  203. * ----------------------------------------------------------------------
  204. *   @(0)² Load At Command Line First File In a Pre-Made List of Files,
  205. *         Faster Version of @1, Does Not Enter All Files In Ring
  206. *        (Emulates PC Magazine's FILECTRL.COM After Loading)
  207. * ----------------------------------------------------------------------
  208.  
  209. * See also ring@0.qm for a separate file with this macro only.
  210. * This macro must be first macro in file to autoexecute at start up.
  211.  
  212. @0  macrobegin
  213. *     horizontalwindow            *
  214. *     editfile escape             *
  215.     changefilename "NUL" return *
  216.     Markline Copy               * Copy selected file name to scrap
  217.     horizontalwindow            *                                           |
  218.     Editfile Paste Return       * Load first file in list
  219.     prevwindow                  * NUL window
  220.  SELECT:                        *
  221.     Pause                       * Pause to select file to edit
  222. *     UnmarkBlock                                                           |
  223.     MarkLine Copy               * Copy selected file name to scrap
  224.     nextwindow                  * Selected file
  225.     EditFile Paste Return       * Edit selected file
  226.     zoomwindow                  * Zoom until <enter>
  227.     Pause                       * <enter> to select another file
  228.  EDIT:                          *
  229.     nextwindow                  * Selected window
  230.     makectrofscreen             *
  231.  jump SELECT:                   * Loop again
  232. *
  233. * 31 bytes Thu  05-09-1991  16:25:46 (TH @0, QLST14.qm)
  234. * 36 bytes Mon  06-24-1991  13:29:54 (TH, @0)
  235. * 33 bytes Wed  06-26-1991  10:26:58 (TH, @0, removed unnecessary unmarkblock)
  236. *                                    (        moved window opening down     )
  237.  
  238.  
  239. * 
  240. * ----------------------------------------------------------------------
  241. *   @(1)  Load At Command Line All Files From a Pre-Made List of Files,
  242. *        (Does *NOT* Emulate PC Magazine's FILECTRL.COM After Loading)
  243. *        (Written by Kyle Watkins of SemWare)
  244. * ----------------------------------------------------------------------
  245. * See ring@1.qm for macro.
  246.  
  247. * 
  248. * ----------------------------------------------------------------------
  249. *  @(2)  Select and Load Files From a PickList of All Files In Ring,
  250. *        File Edit Statuses Are Unchanged
  251. *       (Does *NOT* Emulate PC Magazine's FILECTRL.COM after Loading)
  252. *       (Written by Tom Hogshead and John Goodman)
  253. * ----------------------------------------------------------------------
  254.  
  255. *   The idea for using a unique character to mark position in the NUL file,
  256. *   initially proposed by Richard Blackburn of SemWare, is used in @2.
  257.  
  258. @2  MacroBegin
  259.     PrevFile                    * Position to load NUL file
  260.     unmarkblock dropanchor      * Mark file we start in                     |a
  261.     EditFile "NUL" Return Quit  * Load NUL & quit in case already loaded
  262.     gotoblockbeg                * Return to file we started in              |a
  263.     EditFile Return             * Edit NUL file
  264.     #173 CursorLeft             * Place weird char at line beg
  265.     OneWindow HorizontalWindow  * Open one window with NUL file in
  266.                                 *  window 1, starting file in window 2
  267.     EditFile Escape             *
  268.  FILELOOP:                      * Loop for each file in ring
  269.     FindReplace #173  Return    * Attempt finding weird char in file
  270.       CurrentFileName Return    * Retains current file's name
  271.       "N" Return
  272.  JTrue RINGLIST:                * If char found, must be in NUL file
  273.     PrevWindow                  * Back to NUL file in window 1
  274.     RepeatFind                  * Replace weird character with
  275.                                 *  CurrentFileName from window 1
  276.     AddLine                     * Add another line for another file
  277.     #173 CursorLeft             * Type weird char to find again
  278.     NextWindow NextFile         * Get next file in window 2
  279.  Jump FILELOOP:                 * Go initialize FindReplace, or see if
  280.                                 *  we are in NUL file
  281.  RINGLIST:                      * If here, returned back to NUL file
  282.     DelLine                     * Delete entry for NUL file
  283.     BegFile                     * Go to NUL file beg
  284.     OneWindow                   * Close all windows, NUL file loaded
  285.     Pause                       * Pause to select file to edit
  286.     UnmarkBlock MarkLine        * Unmark prompt, mark selected file
  287.     Copy                        * Copy file name to scrap
  288.     EditFile Paste Return       * Edit selected file
  289. *
  290. * 57 bytes Thu  05-16-1991  18:56:42 (JG/TH, @2 for all QCONFIG window opts)
  291. * 57 bytes Sat  06-22-1991  16:40:55 (TH @2, changed #250 to #173)
  292. * 56 bytes Tue  06-25-1991  14:45:47 (TH @2, not quit NUL)
  293. * 59 bytes Fri  08-02-1991  10:16:35 (TH @2, changed ring positions |a)
  294.  
  295. * 
  296. * ----------------------------------------------------------------------
  297. *   @(3)² Select and Load Files From a PickList of All Files In Ring
  298. *        (Emulates PC Magazine's FILECTRL.COM)
  299. * ----------------------------------------------------------------------
  300.  
  301. *   This macro emulates PC Magazine's  July 1991 FILECTRL.COM written by
  302. *   Michael J. Mefford.  A  window with a list of  all files in the ring
  303. *   allows the user  to select different files  for editing by cursoring
  304. *   down to  the desired  file and  pressing <enter>.   Pressing <enter>
  305. *   again while editing  the selected file returns  the user to the file
  306. *   selection window to select another file. Until this macro is stopped
  307. *   by  pressing  <escape>  three  times, no  other  macro  may  be run.
  308.  
  309.  
  310. @3  MacroBegin
  311.     PrevFile                    * Position to load NUL file
  312.     unmarkblock dropanchor      * Mark file we start in                     |a
  313.     EditFile "NUL" Return Quit  * Load NUL & quit in case already loaded
  314.     gotoblockbeg                * Return to file we started in              |a
  315.     EditFile Return             * Edit NUL file
  316.     #173 CursorLeft             * Place weird char at line beg
  317.     OneWindow                   * Close all windows
  318.     HorizontalWindow            * Open one window with NUL file in
  319.                                 *  window 1, starting file in window 2
  320.     EditFile Escape             * In case QCONFIG "Prompt for filename
  321.                                 *  on open window (Y/N)?" option=[Y]
  322.  FILELOOP:                      * Loop for each file in ring
  323.     FindReplace #173  Return    * Attempt finding weird char in file
  324.       CurrentFileName Return    *  Retains current file's name
  325.                   "N" Return    *
  326.  JTrue RINGLIST:                * If char found, must be in NUL file
  327.     PrevWindow                  * Back to NUL file in window 1
  328.     RepeatFind                  * Replace weird character with
  329.                                 *  CurrentFileName from window 1
  330.     AddLine                     * Add another line for another file
  331.     #173 CursorLeft             * Type weird char to find again
  332.     NextWindow NextFile         * Get next file in window 2
  333.  Jump FILELOOP:                 * Go initialize FindReplace, or see if
  334.                                 *  we are in NUL file
  335.  RINGLIST:                      * If here, go to NUL file
  336.     NEXTFILE                    *                                       |
  337.     prevwindow                  * NUL window
  338.     DelLine                     * Delete entry for NUL file
  339.     BegFile                     * Go to NUL file beg
  340.  SELECT:                        *
  341.     Pause                       * Pause to select file to edit
  342.     UnmarkBlock MarkLine        * Unmark, mark selected file
  343.     Copy                        * Copy selected file name to scrap
  344.     nextwindow                  *
  345.     EditFile Paste Return       * Edit selected file
  346.     zoomwindow                  *
  347.     Pause                       *
  348.  EDIT:                          *
  349.     nextwindow                  * File window
  350.     makectrofscreen             *
  351.  jump SELECT:                   *
  352. *
  353. * 67 bytes Fri  06-21-1991  14:03:40 (TH @3)
  354. * 67 bytes Sat  06-22-1991  13:40:21 (TH @3, changed #250 to #173)
  355. * 68 bytes Sun  06-23-1991  15:33:08 (TH @3 added NextFile)
  356. * 65 bytes Mon  06-24-1991  21:14:14 (TH @3, shortened)
  357. * 68 bytes Fri  08-02-1991  10:24:36 (TH @3, changed ring positions |a)
  358.  
  359.  
  360.  
  361. * 
  362. * ----------------------------------------------------------------------
  363. *   @(4)² Select and Load Files From a DOS "DIR" Picklist, User Inputs
  364. *         File Pattern To Make PickList
  365. *        (Emulates PC Magazine's FILECTRL.COM)
  366. * ----------------------------------------------------------------------
  367.  
  368. *   This macro emulates PC Magazine's July 1991 FILECTRL.COM written by
  369. *   Michael J. Mefford.  DOS Dir is  used to make a FileList.  A window
  370. *   containing a  list of  all files in  the directory  matching a user
  371. *   determined file pattern  allows the user  to select a  file to load
  372. *   and  edit  by  cursoring  down to  the  desired  file  and pressing
  373. *   <enter>.  Pressing <enter>  again while  editing the  selected file
  374. *   returns the  user to  the file  selection window  to select another
  375. *   file. Until this macro is stopped by pressing <escape> three times,
  376. *   no other macro  may be run.  DIR FileList is sorted alphabetically.
  377.  
  378. @4  Macrobegin
  379.     AltWordSet                  * For all file names
  380.     PrevFile                    *
  381.     EditFile "c:!" Return Quit  * Quit sorted file list if loaded
  382.     OneWindow                   * Close all windows
  383.         Dos "DIR " Pause EndLine ">c:!"     * Make DIR list to temp file
  384.         return return                       *
  385.         EditFile Return                     * Load list
  386. *         EditFile "c:!" return               * Load list
  387.             DelLine 4                       * Delete header info
  388.                                             * May have to change DOSVER >3.3
  389.             EndFile DelLine                 * Delete totals line
  390.             JFalse ABORT:                   * Failed?  NO FILES!
  391.             BegFile                         * Back to bof, please.
  392.  LOOPDIR: *------- Remove <DIR> Lines Loop -------*
  393.             Find "<" Return Return          * Find <dir>
  394.             Jfalse ENDDIR:                  * If false, no more <dir>'s,
  395.             Delline                         *ELSE Delete <dir> line
  396.             CursorLeft                      *
  397.             Jump LOOPDIR:                   * And do 'till done
  398.         ENDDIR:
  399.             Endfile Markcolumn              *                           |
  400.             BegFile                         * BOF for sorting           |
  401.             Sort                            * Sort by name              |
  402.             MarkLine                        * Make a line block         |
  403.             GotoColumn "9" Return           * Go to where "." goes
  404.             GotoBlockend                    *
  405.             MarkColumn                      * Start column block
  406.             PrevPosition                    * Move to top of block
  407.             Fillblock "." Return            * Insert dot's
  408.             UnmarkBlock                     *
  409.         SPACEOUT:                           *
  410.             GotoColumn "13" Return          *
  411.             MarkColumn                      *
  412.             EndFile                         *
  413.             MarkColumn                      *
  414.             Cut                             *
  415.             BegFile                         *
  416.             FindReplace " " Return          * replace all spaces with
  417.             DelLine Return                  * NOTHING!
  418.             "NG" Return                     * No prompting, just do it.
  419.             GotoColumn "13" Return          *
  420.             Paste                           *
  421.             UnmarkBlock                     *
  422.  ABORT:                                     *
  423.     BegFile                                 *
  424.     HorizontalWindow            * Open one window                       |
  425.     EditFile Escape             * In case QCONFIG "Prompt for filename  |
  426.                                 *  on open window (Y/N)?" option=[Y]    |
  427.     PrevWindow                  * Window 1                              |
  428.     EditFile Return             * Load file list window 1
  429.  SELECT:                        *
  430.     Pause                       * Pause to select file to edit
  431.     UnmarkBlock                 *
  432.     BegLine                     *
  433.     MarkWord                    *
  434.     Copy                        * Copy selected file name to scrap
  435.     NextWindow                  *
  436.     EditFile Paste Return       * Edit selected file
  437.     ZoomWindow                  *
  438.     Pause                       * Pause to edit file, <enter> to select
  439.                                 *  another file
  440.  EDIT:                          *
  441.     NextWindow                  * Select window 1
  442.     MakeCtrofScreen             *
  443.  jump SELECT:                   *
  444. *
  445. * 142 bytes Sun  06-23-1991  12:49:31 (TH @3)
  446. * 142 bytes Sun  06-23-1991  15:34:15 (TH @3, added PrevFile, rmvd. Zoom)
  447. * 139 bytes Mon  06-24-1991  16:52:14 (TH @3, added sort)
  448. * 133 bytes Mon  06-24-1991  21:13:40 (TH @3, removed extra c:!)
  449.  
  450. * 
  451. * ----------------------------------------------------------------------
  452. *   @(5)² Select and Load Files From a PickList Made Using Directory
  453. *         Extended, DX.EXE, User Selects Desired File Extension and
  454. *         Sort Options From a Pre-Made File "FILE.SRT" To Make PickList
  455. *        (Emulates PC Magazine's FILECTRL.COM)
  456. * ----------------------------------------------------------------------
  457.  
  458. *   This macro emulates PC Magazine's July 1991 FILECTRL.COM written by
  459. *   Michael J. Mefford.  DX.EXE  Directory Extended  is used  to make a
  460. *   File List sorted by Name, Date or Extension. DX.EXE must be located
  461. *   in  the  path. A  window  containing a  list  of all  files  in the
  462. *   directory matching a  user determined file  pattern allows the user
  463. *   to select a file to load and  edit by cursoring down to the desired
  464. *   file and pressing <enter>. Pressing <enter> again while editing the
  465. *   selected  file returns  the user  to the  file selection  window to
  466. *   select  another  file.  Until this  macro  is  stopped  by pressing
  467. *   <escape> three times, no other macro may be run.
  468.  
  469. *   DX.EXE is contained in AMAC-PRG.ZIP,  or see  AMACxx.ZIP/FILExx.ZIP
  470. *   for other download sources.
  471.  
  472. *   Before running this macro,  *make*  the following two files if they
  473. *   are not available:
  474.  
  475. *   ┌───-──────────────── FILE.SRT ───────────────────────────────────────
  476. *   │ qm     d-    date  - Cursor down to select extension (col 1) and
  477. *   │ bak    d-    date    sorting option (col 2), then [enter]
  478. *   │ bat    d-    date           d-  descending date
  479. *   │ *      d-    date           n-  descending name
  480. *   │ qm     n     name           a+  ascending  extension
  481. *   │ bak    n     name  - Must have Directory Extended DX.EXE in path
  482. *   │ bat    n     name  - Add/Delete extensions and sorting options
  483. *   │ *      n     name  - Extension "*" selects all files in directory
  484. *   │ *      ed-   ext/date
  485. *   │ *      en    ext/name
  486. *   └─────────────────────────────────────────────────────────────────────
  487.  
  488. *   ┌─────────────────── PICK2.BAT ───────────────────
  489. *   │ @echo PICK2.BAT                    June 23, 1991
  490. *   │ @DX.EXE %1 //SING/HE:0/ST:1/AT:d-/SO:%2/Out:>c:!
  491. *   └─────────────────────────────────────────────────
  492.  
  493. @5  Macrobegin
  494.     AltWordSet                  * For all file names
  495.     EditFile "FILE.SRT" Return  * Load sort list
  496.     Pause                       * Select sort type
  497.     MarkLine Copy               * Copy line to scrap
  498.     Quit                        * Quit FILE.SRT
  499.     DOS "PICK2" " ."            * Make/sort file list                   |
  500.     Paste Return Return         *
  501.     PrevFile                    * Position to load DIR list
  502.     EditFile "c:!" Return Quit  * Quit sorted file list if loaded
  503.     OneWindow                   * Close all windows
  504.     HorizontalWindow            * Open one window
  505.     EditFile Escape             *
  506.     PrevWindow                  * Window 1
  507.     EditFile Return             * Load sorted file list window 1
  508.  SELECT:                        *
  509.     Pause                       * Pause to select file to edit
  510.     UnmarkBlock                 *
  511.     BegLine WordRight MarkWord  *
  512.     Copy                        * Copy selected file name to scrap
  513.     NextWindow                  *
  514.     EditFile Paste Return       * Edit selected file
  515.     ZoomWindow                  *
  516.     Pause                       *
  517.  EDIT:                          *
  518.     NextWindow                  * Select window 1
  519.     MakeCtrofScreen             *
  520.  jump SELECT:                   *
  521. *
  522. * 91 bytes Sun  06-23-1991  16:05:13 (TH @5, removed Zoom, corrected FILE.SRT)
  523. * 83 bytes Mon  06-24-1991  21:14:31 (TH @5, moved window open down)
  524. * 79 bytes Wed  06-26-1991  18:25:31 (TH @5, changed batch file to PICK2.BAT)
  525.  
  526. * 
  527. * ----------------------------------------------------------------------
  528. *   @(6)² Select and Load Files From a PickList Made Using Directory
  529. *         Extended, DX.EXE, User Inputs File Pattern and Sorting Options
  530. *         To Make PickList
  531. *        (Emulates PC Magazine's FILECTRL.COM)
  532. * ----------------------------------------------------------------------
  533. *
  534. *   This macro emulates PC Magazine's July 1991 FILECTRL.COM written by
  535. *   Michael J. Mefford. User  specifies file pattern and sorting option
  536. *   at the DOS prompt. DX.EXE Directory Extended is used to make a file
  537. *   PickList  sorted by  Name, Date or  Extension. File  DX.EXE must be
  538. *   located in the path. A window containing a PickList of all files in
  539. *   the  directory matching  a user  specified file  pattern allows the
  540. *   user to  select a file  to load and  edit by cursoring  down to the
  541. *   desired  file and  pressing <enter>.  Pressing <enter>  again while
  542. *   editing the  selected file returns  the user to  the file selection
  543. *   window to  select another  file.   Until this  macro is  stopped by
  544. *   pressing   <escape>   three  times,  no  other  macro  may  be run.
  545.  
  546. *   DX.EXE is contained in AMAC-PRG.ZIP,  or see  AMACxx.ZIP/FILExx.ZIP
  547. *   for other download sources.
  548.  
  549. *   SYNTAX:   [ FileName(s) ]  [ File Sort Options (esda) ]  <enter>
  550.  
  551. *   Sort option without a value  sorts files by name and then extension
  552. *   in  ascending order.  Sorting criteria are:  "N" for  name, "E" for
  553. *   extension,  "S"  for size,  "D" for  date/time, "A"  for attribute.
  554. *   Specifying  a sorting  option  with  with a  "+"  suffix  indicates
  555. *   ascending   order;  specifying  a  "-" suffix indicates  descending
  556. *   order.
  557.  
  558. *   Sorting Examples:
  559. *   -----------------
  560. *         [filename(s)] ne    => sort by name and extension
  561. *         [filename(s)] e-n-  => sort files descending by extension
  562. *                                first and then by                              descending name
  563. *         [filename(s)] snd-  => sort files by ascending size, ascending
  564. *                                name, and then descending date
  565.  
  566. *   "C*.*  s-" sorts files in the current directory beginning with the
  567. *   letter "C" by size, largest first. A space must be included between
  568. *   name/sort option!
  569.  
  570. *   Before running this macro,  *make*  the following batch file if it is
  571. *   not available:
  572.  
  573. *   ┌─────────────────── PICK2.BAT ───────────────────
  574. *   │ @echo PICK2.BAT                    June 23, 1991
  575. *   │ @DX.EXE %1 //SING/HE:0/ST:1/AT:d-/SO:%2/Out:>c:!
  576. *   └─────────────────────────────────────────────────
  577.  
  578. @6  Macrobegin
  579.     AltWordSet                  * For all file names
  580.     EditFile "c:!" Return Quit  * Quit PickList if loaded
  581.     DOS "PICK2 "                * Make PickList
  582.     Pause return return         *
  583.     OneWindow                   * Close all windows
  584.     PrevFile                    * Position to load DIR list
  585.     HorizontalWindow            * Open one window
  586.     EditFile Escape             *
  587.     PrevWindow                  * Window 1
  588.     EditFile "c:!" return       * Load PickList window 1
  589.  SELECT:                        *
  590.     Pause                       * Pause to select file to edit
  591.     UnmarkBlock                 *
  592.     BegLine WordRight MarkWord  *
  593.     Copy                        * Copy selected file name to scrap
  594.     NextWindow                  *
  595.     EditFile Paste Return       * Edit selected file
  596.     ZoomWindow                  *
  597.     Pause                       *
  598.  EDIT:                          *
  599.     NextWindow                  * Return to PickList for another selection
  600.     MakeCtrofScreen             *
  601.  jump SELECT:                   *
  602. *
  603. * 61 bytes Mon  06-24-1991  13:47:54 (@6, TH)
  604.  
  605.  
  606. * 
  607. * ----------------------------------------------------------------------
  608. *   @(7)² Load At Command Line All Files From a Pre-Made List of Files,
  609. *         Modification of @1
  610. *        (Emulates PC Magazine's FILECTRL.COM After Loading)
  611. * ----------------------------------------------------------------------
  612. * See also ring@7.qm for macro.
  613.  
  614. @7  MacroBegin
  615.     changefilename "NUL" return *                                           |
  616. *-- This section written by Kyles Watkins of SemWare -----
  617.     EndFile BegLine             * start at last line
  618.   REPEAT:
  619. *     UnmarkBlock                 * (line removed by TH, not needed)        |
  620.     MarkLine Copy               * grab this name
  621.     EditFile                    * get ready to load
  622.     CurrentFilename " "         * to force return *here*
  623.     Paste Return                * paste file name & do it!
  624.     CursorUp                    * more lines above?
  625.     JTrue REPEAT:               * if yes, repeat.
  626. *---------------------------------------------------------
  627. *     OneWindow                   * Close all windows (not necessary)       |
  628.     HorizontalWindow            * Open one window
  629.     EditFile Paste Return
  630.     PrevWindow                  * Window 1
  631.  SELECT:                        *
  632.     Pause                       * Pause to select file to edit
  633.     UnmarkBlock                 *
  634.     BegLine MarkLine            *
  635.     Copy                        * Copy selected file name to scrap
  636.     NextWindow                  *
  637.     EditFile Paste Return       * Edit selected file
  638.     ZoomWindow                  *
  639.     Pause                       *
  640.  EDIT:                          *
  641.     NextWindow                  * Return to PickList for another selection
  642.     MakeCtrofScreen             *
  643.  jump SELECT:                   *
  644. *
  645. * 41 bytes Mon  06-24-1991  23:23:00 (TH @7)
  646. * 47 bytes Wed  06-26-1991  10:12:41 (TH @7, added changefilename "NUL")
  647. *                                    (       removed unnecessary unmarkblock)
  648. *                                    (       removed unnecessary onewindow  )
  649.  
  650.  
  651. * 
  652. * ----------------------------------------------------------------------
  653. *   @(8)² Load While Editing All Files In Pre-Made List of Files,
  654. *         Modification of @1
  655. *        (Emulate PC Magazine's FILECTRL.COM),
  656. * ----------------------------------------------------------------------
  657.  
  658. @8  MacroBegin
  659.     onewindow                   *
  660.     prevfile                    *
  661.     horizontalwindow            *
  662.     editfile escape             *
  663.     prevwindow                  *
  664.     EditFile "NUL" Return       * Edit NUL to load all files in ring
  665.     EndFile BegLine             * start at last line
  666.   REPEAT:                       *
  667. *     UnmarkBlock                 *                                         |
  668.     MarkLine Copy               * grab this name
  669.     EditFile                    * get ready to load
  670.     CurrentFilename " "         * to force return *here*
  671.     Paste Return                * paste file name & do it!
  672.     CursorUp                    * more lines above?
  673.     JTrue REPEAT:               * if yes, repeat.
  674.  SELECT:                        *
  675.     Pause                       * Pause to select file to edit
  676.     UnmarkBlock MarkLine        * Unmark, mark selected file
  677.     Copy                        * Copy selected file name to scrap
  678.     nextwindow                  * Selected file
  679.     EditFile Paste Return       * Edit selected file
  680.     zoomwindow                  * Zoom until <enter>
  681.     Pause                       * <enter> to select another file
  682.  EDIT:                          *
  683.     nextwindow                  * Selected window
  684.     makectrofscreen             *
  685.  jump SELECT:                   * Loop again
  686. *
  687. * 48 bytes Tue  06-25-1991  14:36:14 (TH @8)
  688. * 47 bytes Wed  06-26-1991  13:51:29 (TH @8, removed unnecessary unmarkblock)
  689.  
  690. * 
  691. * ----------------------------------------------------------------------
  692. *   @(9)² Begin or Continue Emulation of PC Magazine's FILECTRL.COM
  693. *         After Macros @1 to @7 Have Been Stopped
  694. * ----------------------------------------------------------------------
  695.  
  696. @9  macrobegin
  697.     onewindow                   *
  698.     horizontalwindow            *
  699.     editfile escape             *
  700.     prevfile prevwindow         *
  701.     editfile "NUL" return       *
  702.  SELECT:                        *
  703.     Pause                       * Pause to select file to edit
  704.     MarkLine Copy               * Copy selected file name to scrap
  705.     nextwindow                  *
  706.     EditFile Paste Return       * Edit selected file
  707.     zoomwindow                  *
  708.     Pause                       *
  709.  EDIT:                          *
  710.     nextwindow                  * File window
  711.     makectrofscreen             *
  712.  jump SELECT:                   *
  713. *
  714. * 31 bytes Thu  05-09-1991  16:25:46 (TH @0, QLST14.qm)
  715. * 32 bytes Mon  06-24-1991  13:30:07 (TH @9)
  716.  
  717. * 
  718. * ----------------------------------------------------------------------
  719. * @(f1)  Load Previously Saved List of Files Made With @f2
  720. * ----------------------------------------------------------------------
  721.  
  722. * This macro loads the list of files previously saved with @2.  This is
  723. * a modification to a macro written by Kyle Watkins of SemWare to load
  724. * a list of files and macro @2 above.
  725.  
  726. * If this macro is the first macro in a file named 'ring@f1.qm', the
  727. * following batch file, 'ring.bat' will load from the command line the
  728. * list of files previously saved with @f2, with the file you were
  729. * editing when @f2 was invoked, loaded:
  730.  
  731. *                   q.exe  qstat  /Ering@f1.mac
  732.  
  733. * See ring@f1.qm for macro.
  734.  
  735.  
  736. * 
  737. * ----------------------------------------------------------------------
  738. *  @(f2)  Save List of Files In Ring
  739. * ----------------------------------------------------------------------
  740.  
  741. * This macro saves a list of files loaded in the ring.  If files have
  742. * been changed, it will prompt you with "Save Changes (Y/N)?".  This
  743. * macro is based on a technique originally written by Richard Blackburn
  744. * of SemWare and modified by me to use windows.
  745.  
  746. @f2 MacroBegin
  747.     PrevFile                        * Position to load NUL file
  748.     unmarkblock dropanchor          * Mark file we start in
  749.     EditFile "NUL" Return Quit      * Load NUL & quit in case already loaded
  750.     gotoblockbeg                    * Return to file we started in
  751.     EditFile Return                 * Edit NUL file
  752.     #173 CursorLeft                 * Place weird char at line beg
  753.     OneWindow HorizontalWindow      * Open one window with NUL file in
  754.                                     *  window 1, starting file in window 2
  755.     EditFile Escape                 *
  756.  FILELOOP:                          * Loop for each file in ring
  757.     FindReplace #173  Return        * Attempt finding weird char in file
  758.       CurrentFileName Return        * Retains current file's name
  759.       "N" Return
  760.  JTrue RINGLIST:                    * If char found, must be in NUL file
  761.     PrevWindow                      * Back to NUL file in window 1
  762.     RepeatFind                      * Replace weird character with
  763.                                     *  CurrentFileName from window 1
  764.     AddLine                         * Add another line for another file
  765.     #173 CursorLeft                 * Type weird char to find again
  766.     NextWindow NextFile             * Get next file in window 2
  767.  Jump FILELOOP:                     * Go initialize FindReplace, or see if
  768.                                     *  we are in NUL file
  769.  RINGLIST:                          * If here, returned back to NUL file
  770.     DelLine                         * Delete entry for NUL file
  771.     BegFile                         * Go to NUL file beg
  772.     OneWindow                       * Close all windows, NUL file loaded
  773.     unmarkblock                     * Unmark starting mark
  774.     writeblock "qstat" return       * Save list of files in ring
  775.     "o"                             * Overwrite option in case list exists
  776.     quit                            * Quit NUL
  777.     gexit                           * Exit with prompt to save changed files
  778. *
  779. * 69 bytes Fri  08-02-1991  11:50:48 (TH @f2)
  780.  
  781.  
  782. * 
  783. * ----------------------------------------------------------------------
  784. *  @(F6)  Makes a DIR List of Filenames in Conventional "8.3" Format,
  785. *                 NO SPACES, with Date and Time, like this:
  786. *                 FILE25.QM       64795   6-23-91   4:12a
  787. * ----------------------------------------------------------------------
  788.  
  789. *  DOS DIR  command produces a  list of files  with filenames containing
  790. *  space and  no dot  between the file  name prefix  and extension. This
  791. *  macro modifies  my earlier  macro in AMACxx.ZIP(v38)/FILExx.ZIP(v24),
  792. *  based on a macro written by Tim Farley, to produce a list of files in
  793. *  conventional "8.3" format.  This macro is  faster and "smoother" than
  794. *  the previous versions.  Removing the three lines near then end of the
  795. *  macro produces a  file list without the date and time. Wild cards are    |
  796. *  OK.
  797.  
  798. *  DIR <enter> gives this...
  799. *---------------------------
  800. *  Volume in drive E is Seagate 1
  801. *  Directory of  E:\UP
  802. *
  803. * .            <DIR>
  804. * ..           <DIR>
  805. * TEMP         <DIR>      6-23-91   9:47a
  806. *     .
  807. * FILE25   QM     64795   6-23-91   4:12a
  808. *     .
  809. *       347 File(s)   4513792 bytes free
  810.  
  811. *  @F6 <enter> gives this...
  812. *---------------------------
  813. *     .
  814. * FILE25.QM       64795   6-23-91   4:12a
  815. *     .
  816.  
  817. @F6     macrobegin
  818.         AltWordSet                      * For all file names
  819.         Dos "DIR "                      * Do DOS DIR listing
  820.         Pause                           * Pause for file pattern
  821.         EndLine ">c:!" return return    *
  822.         EditFile "c:!" Return Quit      * Quit temp file if loaded
  823.         editfile return                 * Load DIR list
  824.         DelLine 4                       * Delete header info
  825.                                         * May have to change for DOSVER >3.3
  826.         EndFile DelLine                 * Delete totals line
  827.         JFalse ABORT:                   * Failed?  NO FILES!
  828.         BegFile                         * Back to bof, please.
  829.  LOOPDIR: *------- Remove <DIR> Lines Loop -------*
  830.         Find "<" Return DelLine Return  * Find <dir>
  831.         Jfalse ENDDIR:                  * If false, no more <dir>'s,
  832.         Delline                         *ELSE Delete <dir> line
  833.         CursorLeft                      *
  834.         Jump LOOPDIR:                   * And do 'till done
  835.  ENDDIR:
  836.         Endfile Markcolumn              *                           |
  837.         BegFile                         * BOF for sorting           |
  838.         Sort                            * Sort by name              |
  839.         MarkLine                        * Make a line block         |
  840.         Gotocolumn "9" return           * Go to where "." goes
  841.         gotoblockend                    *
  842.         markcolumn                      * Start column block
  843.         prevposition                    * Move to top of block
  844.         Fillblock "." return            * Insert dot's
  845.         unmarkblock                     *
  846.  SPACEOUT:                              *
  847.         gotocolumn "13" return          *
  848.         markcolumn                      *
  849.         endfile                         *
  850.         markcolumn                      *
  851.         cut                             * Cut Date and Time to scrap
  852.         BegFile                         *
  853.         FindReplace " " Return          * Replace all spaces with
  854.         DelLine Return                  * NOTHING!
  855.         "NG" Return                     * No prompting, just do it.
  856. * --------- Remove next three lines to remove Date and Time ---------*
  857.         gotocolumn "13" return          *
  858.         paste                           * Paste Date and Time back
  859.         unmarkblock                     *
  860. * -------------------------------------------------------------------*
  861.  ABORT:                                 *
  862.         defaultwordset                  *
  863.         begfile                         *
  864. *
  865. * 110 bytes Sun  06-23-1991  10:20:14 (TH @f6)
  866. * 111 bytes Tue  06-25-1991  14:57:15 (TH @f6, | sort names)
  867.  
  868. * 
  869. * ----------------------------------------------------------------------
  870. * @(h)  Jump From Index Line To (Locate) Macro or Item In Document Below
  871. * ----------------------------------------------------------------------
  872.  
  873. *        Alt_h can be used to quickly jump from Index Line to the desired
  874. *        item or macro in the document below:
  875.  
  876. *        1. Press Alt and h at the same time. Line 1 is marked to
  877. *           highlight. Cursor down to desired line in Index.
  878.  
  879. *        2. Press Enter. The macro then locates and jumps to the item
  880. *           selected on the cursor line in the document below.
  881.  
  882. *   See BOOKxx.Qm and JMPPOSxx.QM in AMACxx.ZIP for more discussion about
  883. *   using bookmarks and positions markers ( ) to jump to positions in
  884. *   files.
  885.  
  886. @h macrobegin
  887.         unmarkblock                     * Unmark any marked blocks
  888.         defaultwordset                  * In case altwordset on
  889.         begfile                         *
  890.         endpara                         * Move to end of Index
  891.         markline                        * Mark it
  892.         begfile                         * Move to bof
  893.         find "(" return "L" return      * Locate first Index selection line
  894.     jfalse NOMARK:                      *
  895.         makectrofscreen                 * Show top of file
  896.         begfile                         * Move back to bof
  897.         unmarkblock markline markline   * And highlight line 1
  898.         prevposition                    * Move back to first selection line
  899.         begline                         * Cursor in col 1
  900.         pause                           * Pause for Index selection
  901.         wordright markword              * Mark first word on line
  902.         copy                            * Copy word to scrap
  903.         endpara                         * Go to end of Index
  904.         find "(" paste ")"              *
  905.         return "I" return               * Find first marked word in doc
  906.     jfalse NOMARK:                      *
  907.         begline                         * If mark found go to begline
  908.         maketopofscreen scrollup        * Cursor on line 2                |a
  909.     jump END:                           *
  910.     NOMARK:                             *
  911.         begfile                         * If no mark found go to begfile
  912.     END:
  913. *
  914. * 52 bytes Wed  07-31-1991  14:43:31 (TH @h, @4 in BOOKxx.QM)
  915.  
  916. * 
  917. * ----------------------------------------------------------------------
  918. * @(r) Reset to DefaultWordSet After Macros Complete
  919. * ----------------------------------------------------------------------
  920.  
  921. @r  defaultwordset
  922.  
  923. * 
  924. * ----------------------------------------------------------------------
  925. *   (NEWKEY) macro to stop macro at pause, close all windows, and set
  926. *    defaultwordset:
  927. * ----------------------------------------------------------------------
  928.  
  929. *   <esc><esc><esc><ctrlo>o< key_assigned_to_defaultwordset >
  930.  
  931. *   The above NEWKEY macro simulates a QEdit macro:
  932. *                           escape escape escape
  933. *                           onewindow
  934. *                           defaultwordset
  935.  
  936. *                          (Version) History
  937. *   =====================================================================
  938. *   June 25, 1991  1.0  -   Initial
  939. *   July 2, 1991   1.1  -   Corrected documentation
  940. *                       -   Added changefilename "NUL" to @7 to be
  941. *                           consistent with @0.
  942. *                       -   Removed unnecessary unmarkblock in @0/7/8.
  943. *                       -   Removed unnecessary onewindow in @7.
  944. *                       -   Moved window opening down in @0.
  945. *                       -   Changed @5 to use PICK2.BAT only.  FILE-DX2.BAT
  946. *                           is now not needed for any RINGxx.QM macro.
  947. *   July 5, 1991   1.1a -   Minor documentation changes.
  948. *   July 10, 1991       -   Added latest version of @h.
  949. *   August 2, 1991 1.2  -   Changed ring positions in @2 and @3.
  950. *                       -   Added @f1 and @f2 to save and restore ring files.
  951. *                       -   Changed @f key to @r.
  952. *   August 3, 1991      -   Macros @1, @7 and @f1 are now only in subfiles
  953. *                           for use to autoexecute at start up.
  954. *                       -   Added latest version of @h.
  955. *                                   (Included in AMACxx v 4.0)
  956. *                  1.2a -   Corrected @7 subfile name in RINGxx.index.  8/6/91
  957. *                       -   Added second copy of @7 to RFRMxx.QM.       8/6/91
  958. *
  959. *
  960. *
  961. *
  962. *
  963. *
  964. *
  965. *
  966.